package com.bwf.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Version v1.0
 * @Description: TODO
 * @Author ZHANZHONGXIN
 * @Date 2022/6/9 9:45
 * @Copyright 博为峰
 */
public class StudentServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //增
        //删
        //改
        //查
        String method = req.getParameter("method");
        if (method.equals("query")) {
            this.query(req, resp);
        } else if (method.equals("delete")) {
            this.delete(req, resp);
        }
    }

    public void delete(HttpServletRequest req, HttpServletResponse resp) {
        String id = req.getParameter("id");
    }

    public void query(HttpServletRequest req, HttpServletResponse resp) {
        String name = req.getParameter("name");
        System.out.println("name = " + name);
    }

    public void add() {

    }

    public void update() {

    }
}
